﻿<h2>Post My Job Vacancies</h2>
<div class="row">
    <p align="right">
        <input type="text" class="search-query" placeholder="Search" ng-model="searchText">
    </p>
    <table class="table table-condensed table-hover">
        <tr>
            <th>Vacancy ID</th>
            <th>Vacancy</th>
            <th>Valid From</th>
            <th>Valid To</th>
            <th>Application Quota</th>
            <th>Status</th>
            <th></th>
            <th></th>
        </tr>
        <tr ng-repeat="vacancy in vacancys | filter:searchText">
            <td><a href="/detail/{{vacancy.vacancy_id}}">{{vacancy.vacancy_id}}</a></td>
            <td>{{vacancy.vacancy_for}}</td>
            <td>{{vacancy.valid_from | date:'medium'}}</td>
            <td>{{vacancy.valid_to | date:'medium'}}</td>
            <td>{{vacancy.max_applications}}</td>
            <td>{{vacancy.status | lowercase }}</td>
            <td>
                    <button type="button" class="btn btn-success" ng-disabled="vacancy.status!='POSTED'">Unpost Job</button>
            </td>
            <td>
                    <button type="button" class="btn btn-danger" ng-disabled="vacancy.status!='PLANNED'" onclick="window.open('/Publish/Index/{{vacancy.vacancy_id}}', '_blank')">Post Job</button>
            </td>
        </tr>
    </table>
</div>
